<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="index.css" type="text/css">
</head>
<body>

<ul class="menu">
    <div class="toggle">
        <ion-icon name="add-outline"></ion-icon>
    </div>
    <li style="--i:0;" class="active"><a href="#">
        <ion-icon name="home-outline"></ion-icon>
    </a></li>
    <li style="--i:1;"><a href="#">
        <ion-icon name="person-outline"></ion-icon>
    </a></li>
    <li style="--i:2;"><a href="#">
        <ion-icon name="settings-outline"></ion-icon>
    </a></li>
    <li style="--i:3;"><a href="#">
        <ion-icon name="mail-outline"></ion-icon>
    </a></li>
    <li style="--i:4;"><a href="#">
        <ion-icon name="videocam-outline"></ion-icon>
    </a></li>
    <li style="--i:5;"><a href="#">
        <ion-icon name="key-outline"></ion-icon>
    </a></li>
    <li style="--i:6;"><a href="#">
        <ion-icon name="game-controller-outline"></ion-icon>
    </a></li>
    <li style="--i:7;"><a href="#">
        <ion-icon name="camera-outline"></ion-icon>
    </a></li>
    <div class="indicator"></div>
</ul>

<script>

    let menuToggle = document.querySelector('.toggle');
    let menu = document.querySelector('.menu');
    menuToggle.onclick = function () {
        menu.classList.toggle('active')
        menuToggle.classList.toggle('active')
    }

    const list = document.querySelectorAll('li');

    function activeLink() {
        list.forEach((item) =>
            item.classList.remove('active'));
        this.classList.add('active')
    }

    list.forEach((item) => item.addEventListener('click', activeLink));

</script>

<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>

</body>
</html>
